﻿using LocalizationUtils;
using LocalizationUtils._3rdParty.AOTEasyAlphabetArabic;
using UnityEngine;
using UnityEngine.UI;

namespace LocalizationUtils
{
    public class LocalizationUGUI_InputField : MonoBehaviour
    {
        // 输入框换行
        [HideInInspector] public string _srcTxt = "";
        private string text = "";

        public void CopyText()
        {
            text = GetComponent<InputField>().text;
            _srcTxt = text;
        }


        public void CorrectText()
        {
            if (LocalizationManager.CurrSystemLanguage == LocalizationManager.CustomSystemLanguage.Arabic)
            {
                GetComponent<InputField>().text = EasyArabicCore.CorrectString(text);
            }
            else
            {
                GetComponent<InputField>().text = text;
            }
        }
    }
}